import { Input } from "@cscec/udp-ui";
import { getSchemaTpl, setSchemaTpl } from "amis-editor";
import React from "react";

// 覆写 theme:common
setSchemaTpl(
  'theme:common',
  ({ styleName = 'style' } = {}) => {
    const styles = [
      getSchemaTpl('theme:paddingAndMargin', {
        name: styleName,
      }),
      {
        label: '边框',
        type: 'group',
        mode: 'default',
        body: [
          {
            type: 'style-border',
            name: `${styleName}`,
            mode: 'default',
          },
        ],
      },
      {
        name: `${styleName}.background`,
        label: '背景',
        mode: 'default',
        type: 'input-color',
        clearable: true,
        inputClassName: 'ae-border-colorpicker'
      }
    ];
    return [
      {
        title: '样式',
        body: styles,
      },
      {
        title: '样式源码',
        body: [
          {
            type: 'theme-cssCode',
            label: false,
            isLayout: true,
          },
        ],
      },
    ];
  },
);
